package cc.yugu.yhdw.common.domain.hdw;

import cc.yugu.yhdw.common.domain.IntIdEntity;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * 商品
 */
public class Item extends IntIdEntity implements ThingEntity {

    public enum Status {
        CLOSE((byte) 1, "下架"), OPEN((byte) 2, "上架");

        private final byte value;
        private final String name;

        private Status(byte value, String name) {
            this.value = value;
            this.name = name;
        }

        private static Map<Integer, String> map = new HashMap<Integer, String>();
        static {
            for (Status e : Status.values()) {
                map.put(e.getValue(), e.getName());
            }
        }

        public static String getName(int value) {
            return map.get(value);
        }

        public int getValue() {
            return value;
        }

        public String getName() {
            return name;
        }
    }

    Integer orderNum; //排序号
    Integer categoryId; //分类ID
    Integer agentId; //所属运营商
    String itemName; //商品名称
    String introduction; //描述
    String imagePath1; //图片路径
    String imagePath2; //图片路径
    String imagePath3; //图片路径
    String imagePath4; //图片路径
    Float showPrice; //显示价格
    Float price; //实际价格
    Float exchangeMoney; //换电金额
    Integer status; //状态
    Date createTime; //创建时间

    @Override
    public Integer getThingId() {
        return getId();
    }

    @Override
    public Integer getThingType() {
        return THING_TYPE_ITEM;
    }

    @Override
    public Float getThingPrice() {
        return price;
    }

    public Float getExchangeMoney() {
        return exchangeMoney;
    }

    public void setExchangeMoney(Float exchangeMoney) {
        this.exchangeMoney = exchangeMoney;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Integer categoryId) {
        this.categoryId = categoryId;
    }

    public Integer getAgentId() {
        return agentId;
    }

    public void setAgentId(Integer agentId) {
        this.agentId = agentId;
    }

    public String getItemName() {
        return itemName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public String getImagePath1() {
        return imagePath1;
    }

    public void setImagePath1(String imagePath1) {
        this.imagePath1 = imagePath1;
    }

    public String getImagePath2() {
        return imagePath2;
    }

    public void setImagePath2(String imagePath2) {
        this.imagePath2 = imagePath2;
    }

    public String getImagePath3() {
        return imagePath3;
    }

    public void setImagePath3(String imagePath3) {
        this.imagePath3 = imagePath3;
    }

    public String getImagePath4() {
        return imagePath4;
    }

    public void setImagePath4(String imagePath4) {
        this.imagePath4 = imagePath4;
    }

    public Float getShowPrice() {
        return showPrice;
    }

    public void setShowPrice(Float showPrice) {
        this.showPrice = showPrice;
    }

    public Float getPrice() {
        return price;
    }

    public void setPrice(Float price) {
        this.price = price;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
